package com.niuwa.p2p.action.channel;

import org.apache.commons.lang3.StringUtils;

import com.niuwa.p2p.action.JsonAction;
import com.niuwa.p2p.entity.channel.Corporation;
import com.niuwa.p2p.exception.BusinessException;
import com.niuwa.p2p.vo.channel.ChannelBasicInfoVo;

public class ChannelCommonAction extends JsonAction{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3955652761088987712L;

	private String channelCode;
	
	private String channelOperateFlg;
	
	private ChannelBasicInfoVo cbiv;

	public String getChannelCode() {
		return channelCode;
	}

	public void setChannelCode(String channelCode) {
		this.channelCode = channelCode;
	}

	public String getChannelOperateFlg() {
		return channelOperateFlg;
	}

	public void setChannelOperateFlg(String channelOperateFlg) {
		this.channelOperateFlg = channelOperateFlg;
	}

	public ChannelBasicInfoVo getCbiv() {
		return cbiv;
	}

	public void setCbiv(ChannelBasicInfoVo cbiv) {
		this.cbiv = cbiv;
	}	
	
	public void validateChannelInfo()throws Exception{
	    Corporation corp = cbiv.getCorporation();
	    
	    if(StringUtils.isEmpty(corp.getCorpName())){
	        throw new BusinessException("channelInfoAction.corporationName.RequiredString.message");
	    }
	}
}
